package com.training.service.impl.chenhao;

import java.util.List;

import com.training.dao.chenhao.EmpDao;
import com.training.pojo.chengshu.MotorRoom;
import com.training.pojo.chengshu.UDept;
import com.training.pojo.chengshu.ULog;
import com.training.pojo.chengshu.UUser;
import com.training.pojo.chengshu.UserRole;
import com.training.service.chenhao.EmpService;

public class EmpServiceImpl implements EmpService {
	private EmpDao empdao;
    
	public List<UUser> emplist(int start,int max) {
	  List<UUser> list = empdao.emplist(start,max);
		return list;
	}
    
	 public  int empsize(){
		 return empdao.empsize();  
	   }
    public List<UDept> deptname() {
    	List<UDept> list = empdao.deptname();
    	for (UDept dept: list) {
    		System.out.println(dept.getDeptname()+dept.getDeptid());
    	}
		return list;
	}
    
	public void addemp(UUser emp, String udept) {
		System.out.println("addempSer");
		empdao.addemp(emp, udept);
	}
   public UUser empdetail(String uid) {
	   UUser emp=empdao.empdetail(uid);
		return emp;
	}
    
	public EmpDao getEmpdao() {
		return empdao;
	}

	public void setEmpdao(EmpDao empdao) {
		this.empdao = empdao;
	}

	
	public void deleteemp(String uid) {
		empdao.deleteemp(uid);
		
	}

	public List<UDept> chaDept(String uid) {
		return empdao.chaDept(uid);
	
	}

	public List<ULog> chaLog(String uid) {
	  
		return empdao.chaLog(uid);
	}

	public List<MotorRoom> chaMotor(String uid) {
		
		return empdao.chaMotor(uid);
	}

	public List<UserRole> chaUserrole(String uid) {
		
		return empdao.chaUserrole(uid);
	}

	public List<UUser> serachemp(Integer utype, Integer deptid, String uname,
			Integer sex) {
		return empdao.serachemp(utype, deptid, uname, sex);
		
	}

	public int findDeptidByUserid(String userid) {
		return empdao.findDeptidByUserid(userid);
		
	}

	public int findUseridBydeptid(int deptid) {
		return empdao.findUseridBydeptid(deptid);
	}

	public void changeemp(int id, final UUser emp,final String deptid) {
		empdao.changeemp(id, emp,deptid);
		
	}


	


	

}
